package com.baidu.mpks.common;

import org.apache.http.client.HttpClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class HttpClientTemplateConfiguration {
    public HttpClientTemplateConfiguration() {
    }

    @Bean
    public HttpClientTemplate httpClientTemplate() {
        HttpClientTemplate template = new HttpClientTemplate();
        HttpClientManager manager = new HttpClientManager();
        manager.init();
        HttpClient httpClient = manager.getHttpclient();
        template.setHttpClient(httpClient);
        return template;
    }
}

